#include<bits/stdc++.h>
using namespace std;
int n,a[202020];
namespace fen1{
	int cnt=0,sum=0;
	bool vis[202020];
	struct as{
		int l,r,color;
	}e[202020];
	void Work(){
		while(sum<n){
			int nowcolor=-1;
			for(int i=1;i<=n;i++){
				if(!vis[i]&&a[i]!=nowcolor){
					nowcolor=a[i];
					printf("%d ",i);
					vis[i]=1;
					sum++;
				}
			}
			printf("\n");
		}
	}
} 
namespace fen2{
	int cnt=0,sum=0;
	bool vis[202020];
	struct as{
		int l,t,r,color;
		int haq,next,buff;
	}e[202020];
	void Work(){
		int now=1;
		for(;now<=n;){
			int flag=a[now];
			e[++cnt].color=flag,e[cnt].l=now,e[cnt].t=now,e[cnt].haq=0;
			for(;now<=n&&a[now]==flag;now++){
				e[cnt].r=now;
			}
		}
		while(sum<cnt){
			for(int i=1;i<=cnt;i++){
				if(e[i].t<=e[i].r&&!e[i].haq){
					printf("%d ",e[i].t++);	
					if(e[i].t>e[i].r){
						int gu=i+1;
						while(e[gu].haq){
							gu++;
						}
						if(e[gu].color==e[i].color){
							e[i].next=i;
							e[gu].buff=1;
						}
					}
				}		
			}
			printf("\n");
		}
	}
}
void In(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
	}
}
int main(){
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	In();
	fen1::Work();
	return 0;
}

